﻿using Sundry.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace Sundry.Areas.Admin.Controllers
{
    public class UploadController : Controller
    {
        //
        // GET: /Admin/Upload/

        /// <summary>
        /// 图片上传
        /// </summary>
        /// <returns></returns>
        public ContentResult UploadImages()
        {
            string operation = ValidateHelper.SafeRequest("operation", "");
            string module = ValidateHelper.SafeRequest("module", "");
            string uid = ValidateHelper.SafeRequest("Uid", "0");
            string result = "-1";
            if (operation == "uploadImage")
            {
                HttpPostedFileBase file = Request.Files[0];
                result= Sundry.App_Start.Common.UploadImgHelper.SaveUploadImage(uid, file, module);
            }
            return Content(result);
        }

    }
}
